<template>
  <div>
    <input placeholder="请输入姓名" v-model="name" />
    <p>全名(大写)：{{ name | formatName }}</p>
  </div>
</template>

<script>
export default {
  name: "FiltersDemo",
  data(){
    return {
      name: ''
    }
  },
  // 过滤器
  filters: {
    formatName: function(value) {
      return value.trim().toUpperCase()
    }
  }
};
</script>

<style scoped></style>
